<template>
  <div
    class="header"
    :style="{
      backgroundImage: `url(${sellerInfo.avatar})`,
    }"
  >
    <div class="masks"></div>
    <div class="info">
      <div class="pic">
        <img :src="sellerInfo.avatar" alt="商家logo" />
      </div>
      <div class="rightTitle">
        <div class="title">
          <h2>{{ sellerInfo.name }}</h2>
        </div>
        <div class="miao">
          <p>{{ sellerInfo.description }}</p>
        </div>
        <div class="youhui">
          <p>在线支付满28减5</p>
          <span>5个</span>
        </div>
      </div>
    </div>
    <div class="tips">
      <p>
        {{ sellerInfo.bulletin }}
      </p>
    </div>
  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex'
export default {
  data() {
    return {
      miaoShu: '',
    }
  },
  created() {
    this.getSeller()
  },
  computed: {
    ...mapState(['sellerInfo']),
  },
  methods: {
    ...mapActions(['getSeller', 'getGoods']),
  },
}
</script>

<style lang="less" scoped>
.header {
  height: 134px;
  background: #333;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  .masks {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    height: 100%;
    background-color: rgba(7, 17, 27, 0.5);
    backdrop-filter: blur(10px);
  }
  .info {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    .pic {
      padding: 24px 0 0 24px;
      img {
        width: 64px;
      }
    }
    .rightTitle {
      padding: 16px 0 0 16px;
      .title {
        color: #fff;
        font-weight: bold;
      }
      .miao {
        color: rgb(255, 255, 255);
        font-weight: 200;
        font-size: 16px;
      }
      .youhui {
        color: rgb(255, 255, 255);
        font-size: 10px;
        font-weight: 200;
        display: flex;
        justify-content: space-between;
        &::before {
          content: '减';
          color: red;
          background: #fff;
          font-size: 12px;
          width: 20px;
          height: 20px;
          text-align: center;
          line-height: 20px;
        }
        span {
          display: block;
          width: 40px;
          height: 24px;
          background: rgb(0, 0, 0, 0.2);
          border-radius: 30px;
          text-align: center;
          line-height: 24px;
          &::after {
            content: '>';
            color: #fff;
          }
        }
      }
    }
  }
  .tips {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 10px;
    color: #fff;
    padding-left: 12px;
    background: rgba(7, 17, 27, 0.2);
    display: flex;
    p {
      height: 28px;
      line-height: 28px;
      width: 85%;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      &::before {
        content: '公告';
        background-color: #fff;
        color: black;
        margin-right: 8px;
      }
    }
    &::after {
      content: '>';
      line-height: 28px;
    }
  }
}
</style>
